/*
 * audioSample_main.c
 *
 */

/** \file   audioSample_main.c
 *
 *  \brief    sample application for demonstration of audio driver usage
 *
 *  This file contains the implementation of the sample appliation for the
 *  demonstration of audio playing through the audio interface layer.
 *
 *             (C) Copyright 2008, Texas Instruments, Inc
 */

/* ========================================================================== */
/*                            INCLUDE FILES                                   */
/* ========================================================================== */

#include <stdio.h>
#include <std.h>
#include <log.h>
#include "ti/pspiom/psc/Psc.h"
#include "ti/pspiom/cslr/cslr_psc_OMAPL137.h"
#include "ti/pspiom/mcasp/Mcasp.h"
#include "ti/pspiom/platforms/codec/Aic31.h"
#include "ti/pspiom/cslr/cslr_psc_OMAPL137.h"
#include "ti/pspiom/platforms/evmOMAPL137/Audio_evmInit.h"
#include "ti/pspiom/platforms/evmOMAPL137/audio/Audio.h"

extern LOG_Obj trace;

/* ========================================================================== */
/*                           MACRO DEFINTIONS                                 */
/* ========================================================================== */

/*
 * Mcasp device params. To be filled in userMcaspInit function which
 * is called before driver creation
 */
Mcasp_Params audioMcaspParams;

/*
 * Aic31 device params. To be filled in userAic31Init function which
 * is called before driver creation
 */
Aic31_Params audioAic31Params;

/*
 * Audio device params. To be filled in userAudioInit function which
 * is called before driver creation
 */

Audio_Params audioParams;

/* ========================================================================== */
/*                           FUNCTION DEFINITIONS                             */
/* ========================================================================== */


/**
 *  \brief  Void main(Void)
 *
 *   Main function of the sample application. This function enables
 *   the mcasp instance in the power sleep controller and also
 *   enables the pinmux for the mcasp 1 instance.
 *
 *  \param  None
 *  \return None
 */
Void main(Void)
{
    LOG_printf(&trace,"\r\nAudio Sample Main\n");

    configureAudio();
    return;
}


/*
 * Aic31 init function called when creating the driver.
 */
void audioUserAic31Init()
{
    Aic31_init();
    audioAic31Params = Aic31_PARAMS;
    audioAic31Params.acCtrlBusName = "/i2c0";
}

/*
 * Mcasp init function called when creating the driver.
 */
void audioUserMcaspInit()
{
    Mcasp_init();
    audioMcaspParams = Mcasp_PARAMS;
    audioMcaspParams.hwiNumber = 8;
}

/*
 * Audio init function called when creating the driver.
 */
void audioUserAudioInit()
{
    Audio_init();
    audioParams = Audio_PARAMS;
    audioParams.adDevType = Audio_DeviceType_McASP;
    audioParams.adDevName = "/mcasp1";
    audioParams.acNumCodecs = 1;
    audioParams.acDevName[0] = "/aic310";
}


/* ========================================================================== */
/*                                END OF FILE                                 */
/* ========================================================================== */
